<template>
    <div class="left">
        <ul>
            <li v-for="(item,index) in categoryList" :key="index"
            :class="index == i?'active':''"
            @click="changeT(item.id,index)"
            >
                {{item.name}}
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    data(){
        return{
            categoryList:[],
            i:0
        }
    },
    created(){
        
    },
    methods:{
        changeT(id,index){
            this.i = index
            this.$emit('fclick',id)
        }
    },
    mounted(){
        
    }
}
</script>

<style lang="scss" scoped>
.left{
    ul{
        li{
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border-bottom: 1px solid #F5F5F5;
        }
        .active{
            color: #DB3D3C;
            border-left: 3px solid #DB3D3C;
        }
    }
}
</style>